<template>
	<view class='income'>
		<view class="tongji dFlex jBetween_aCenter">
			<view class='shouyi'>
				<view class="amount">￥<text class="col">{{info.todayMoney?info.todayMoney:'0.00'}}</text></view>
				<view class="desc">今日收益(元)</view>
			</view>
			<view class='shouyi'>
				<view class="amount">￥<text class="col">{{info.beforeMoney?info.beforeMoney:"0.00"}}</text></view>
				<view class="desc">预收益(元)</view>
			</view>
			<view class='shouyi'>
				<view class="amount">￥<text class="col">{{info.totalMoney?info.totalMoney:'0.00'}}</text></view>
				<view class="desc">总收益(元)</view>
			</view>
		</view>
		<view class="profit">
			<view class="tit">收益明细</view>
			<view class="shops" v-if='list.length'>
				<view class="shopOne" v-for="(item,index) in list" :key='index'>
					<view class="orderInfo dFlex jBetween_aCenter">
						<view class='orderNum'>订单编号：{{item.order_no}}</view>
						<view class="orderTime">{{item.createdate}}</view>
					</view>
					<view class="userInfo dFlex jBetween_aCenter">
						<view class="user">购买人：{{item.nickname}}</view>
						<view class='amount'>金额：{{item.money}}</view>
					</view>
				</view>
			</view>
			<view class="shops empty imgPublic" v-else>
				<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/empty.png" mode="widthFix"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				list:[],
				page:1,
				load:false,
			};
		},
		onLoad(){
			this.initData();
		},
		onReachBottom() {
			if(this.load){
				this.load = false;
				this.page ++ ;
				this.initData();
			}
		},
		methods:{
			initData(){
				this.tool.getData('/api/Sell/getMyMoneyLog',{
					page:this.page,
				}).then(res=>{
					console.log(res);
					if(res){
						this.info = res.info;
						this.list = this.page == '1' ? res.list : this.list.concat(res.list);
						this.load = res.list.length >= 10 ? true : false;
					}
				}).catch(err=>{
					console.log(err);
				})
			}
		}
	}
</script>

<style lang="scss">
	.profit{
		.shopOne{
			width:100%;
			padding:12px 0;
			border-bottom: 1px solid rgba(0, 0, 0, 0.1);
			.userInfo{
				width:100%;
				margin-top: 8px;
				.amount{
					color:#FF5000;
					font-weight:bold;
				}
			}
			.orderInfo{
				.orderNum{
					color:#999999;
				}
				width:100%;
				font-size:12px;
			}
		}
		.tit{
			width:100%;
			font-weight: bold;
			margin-bottom: 8px;
		}
		width:100%;
		padding: 12px;
		box-sizing: border-box;
		background: white;
		margin-top: 12px;
	}
	.tongji{
		.shouyi{
			.amount{
				text{
					font-size:18px;
					
				}
				color:#333333;
				margin-bottom: 4px;
			}
			.col{
				color:#FE5300;
			}
			color:#666666;
			width:50%;
			text-align: center;
			font-size:12px;
		}
		width:100%;
		padding:12px 0;
		background:white;
	}
	page{
		background:#f8f8f8;
	}
</style>
